//
//  SettingHomeTableViewCell.swift
//  EasePods
//
//  Created by 易先生 on 2024/4/7.
//

import UIKit

class SettingHomeTableViewCell: TableViewCell {

    
    override func makeUI() {
        
        self.backgroundColor = .clear
        self.contentView.backgroundColor = .clear
        
        self.contentView.addSubview(cardView)
        cardView.addSubview(iconImageView)
        cardView.addSubview(titleLabel)
        cardView.addSubview(continueImageView)
        
        
        cardView.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(15)
            make.leading.equalToSuperview()
            make.centerX.equalToSuperview()
            make.bottom.equalToSuperview().offset(-7)
        }
        
        iconImageView.snp.makeConstraints { make in
            make.leading.equalTo(16)
            make.centerY.equalToSuperview()
        }
        
        titleLabel.snp.makeConstraints { make in
            make.leading.equalTo(iconImageView.snp.trailing).offset(6)
            make.top.equalToSuperview().offset(18)
            make.bottom.equalToSuperview().offset(-18)
        }
        
        continueImageView.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-16)
            make.centerY.equalToSuperview()
        }

    }
    
    public func bind(to itme: SettingHomeAction) {
        titleLabel.text = itme.title
        iconImageView.image = itme.icon
    }
    
    private lazy var cardView: View = {
        let view = View()
        return view
    }()
    
    private lazy var iconImageView: ImageView = {
        let imageView = ImageView()
        return imageView
    }()
    
    private lazy var titleLabel: Label = {
        let lable = Label()
        lable.font = Fonts.systemFont(ofSize: 16)
        lable.textColor = R.color.common_4_text()
        return lable
    }()
    
    private lazy var continueImageView: ImageView = {
        let imageView = ImageView()
        imageView.image = R.image.ic_common_more_large()
        return imageView
    }()

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
